package com.coco.bargain.controller;

import com.coco.bargain.pojo.TbBargainUser;
import com.coco.bargain.service.BargainUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: guofeng
 * @Date: 2021/07/22/15:03
 * @Description:
 */
@RestController
@RequestMapping("/bargain/user")
public class BargainUserController {


    @Autowired
    private BargainUserService bargainUserService;


    @RequestMapping("/add")
    public void add(@RequestBody TbBargainUser tbBargainUser){
        System.out.println(tbBargainUser);
        bargainUserService.add(tbBargainUser);
    }

    @RequestMapping("/update")
    public void update(@RequestBody TbBargainUser tbBargainUser){
        System.out.println(tbBargainUser);
        bargainUserService.update(tbBargainUser);
    }


    @GetMapping("/findById/{id}")
    public TbBargainUser findById(@PathVariable("id") Long id) {
        return bargainUserService.findById(id);
    }



}

